package com.pr.makfilm.user.pages.room.details.cmp;

import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.extensions.ajax.markup.html.AjaxEditableLabel;
import org.apache.wicket.markup.ComponentTag;
import org.apache.wicket.model.IModel;

/**
 * Created by p.radomski on 28.12.13.
 */
public class EditLabel<T> extends AjaxEditableLabel<T>
{
   public EditLabel(String id, IModel<T> model)
   {
      super(id, model);
      getEditor().add(AttributeAppender.append("class", "form-control"));
   }

   @Override
   protected void onComponentTag(ComponentTag tag)
   {
      super.onComponentTag(tag);
      String css = tag.getAttribute("class");
      css = css == null ? "edit-label" : css + " edit-label";
      tag.put("class", css);
   }
}
